package vip.liux.backend.application.service.customer;

import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;
import vip.liux.contracts.infrastructure.automap.MapMapper;
import vip.liux.contracts.infrastructure.automap.MapStructConfig;
import vip.liux.contracts.models.customer.Customer;

import java.util.List;

@Mapper(config = MapStructConfig.class, uses = {MapMapper.class})
public interface AutoMapperProfile {

    AutoMapperProfile INSTANCE = Mappers.getMapper(AutoMapperProfile.class);

    @Mapping(target = "points", ignore = true)
    @Mapping(target = "balance", ignore = true)
    CustomerDto toDto(Customer source);

    List<CustomerDto> toDtos(List<Customer> source);
}
